import { Args, Context, Mutation, Resolver } from '@nestjs/graphql';
import { UseGuards } from '@nestjs/common';
import { AuthService } from './auth.service';
import { GqlAuthGuard } from './guard/gql-auth.guards';
import { LoginUserInput, LoginUserResponse } from '../user/dto/inputDto';
@Resolver()
export class AuthResolver {
  constructor(private readonly authService: AuthService) { }
  @Mutation(() => LoginUserResponse)
  @UseGuards(GqlAuthGuard)
  login(
    @Args('loginUserInput') _loginUserInput: LoginUserInput,
    @Context() context: any,
  ) {
    return this.authService.login(context.user);
  }
}
